package com.example.chat.model

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import java.sql.Timestamp

@Entity(tableName = "message")
data class Message (
    @PrimaryKey (autoGenerate = true) val id: Long? = null,
    @ColumnInfo(name = "topic_id") val topicId: Long,
    val sender: Long,
    val text: String? = null,
    val image: Int? = null,
    val status: MessageStatus = MessageStatus.New,
    @ColumnInfo(name="create_timestamp") val timestamp: Timestamp = Timestamp(System.currentTimeMillis())
)


enum class MessageStatus {
    New,
    Sending,
    Read,
    Error
}